package cn.xu.tool.big.a.dto;

import lombok.Data;

/**
 * 类名: TradeRecord
 * 描述: TODO
 * 作者: ClarkXu clark2021@qq.com
 * 日期: 2025/7/8
 */
@Data
public class TradeRecord {
    private String date;
    private String operation; // "买入"、"卖出"、"持仓"
    private double price;
    private int position;
    private double cash;
    private double totalAsset;
    private int volume;

    private double tmpReturnRate;

    public static TradeRecord create(String date, String operation, double price, int position, double cash, double totalAsset, int volume){
        TradeRecord tradeRecord = new TradeRecord();
        tradeRecord.setDate(date);
        tradeRecord.setOperation(operation);
        tradeRecord.setPosition(position);
        tradeRecord.setPrice(price);
        tradeRecord.setCash(cash);
        tradeRecord.setTotalAsset(totalAsset);
        tradeRecord.setVolume(volume);
        return tradeRecord;
    }
    public static TradeRecord create(String date, String operation, double price, int position, double cash, double totalAsset, int volume, double tmpReturnRate){
        TradeRecord tradeRecord = new TradeRecord();
        tradeRecord.setDate(date);
        tradeRecord.setOperation(operation);
        tradeRecord.setPosition(position);
        tradeRecord.setPrice(price);
        tradeRecord.setCash(cash);
        tradeRecord.setTotalAsset(totalAsset);
        tradeRecord.setVolume(volume);
        tradeRecord.setTmpReturnRate(tmpReturnRate);
        return tradeRecord;
    }
}
